
<div class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  {{> header}}
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="filter">member
      <li class="layui-nav-item">
          <a class="" href="javascript:;"><i class="layui-icon layui-icon-username layui-icon-menu"></i>用户管理</a>
          <dl class="layui-nav-child layui-nav-child-jsh">
            <dd><a data-id="1" data-url="/manager/member/user" data-title='会员管理' class="site-demo-active" href="javascript:;">会员管理</a></dd>
            <dd><a data-id="2" data-url="userClassify" data-title='会员分类' class="site-demo-active" href="javascript:;">会员分类</a></dd>	
   <!--          <dd><a href="javascript:;" data-id="3">会员权限</a></dd>	 -->
            <dd><a href="javascript:;" data-id="4" data-url="/manager/member/role" data-title='角色管理' class="site-demo-active">角色管理</a></dd> 
            <dd><a href="javascript:;" data-id="5" data-url="userAdministrator" data-title='管理员管理' class="site-demo-active">管理员管理</a></dd>	
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-child-jsh">
          <a class="" href="javascript:;"><i class="layui-icon layui-icon-cart-simple layui-icon-menu"></i>商品管理</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;" data-id="6" data-url="goodsClassify" data-title='商品分类' class="site-demo-active">商品分类</a></dd>

            <dd><a href="javascript:;">商品列表</a></dd>
            <dd><a href="javascript:;">商品单位</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item layui-nav-child-jsh">
          <a class="" href="javascript:;"><i class="layui-icon layui-icon-set layui-icon-menu"></i>网站管理</a>
          <dl class="layui-nav-child">
            <dd><a href="javascript:;">网站设置</a></dd>
            <dd><a href="javascript:;">操作日志</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href=""><i class="layui-icon layui-icon-username layui-icon-menu"></i>订单管理</a></li>
        <li class="layui-nav-item"><a href=""><i class="layui-icon layui-icon-rmb layui-icon-menu"></i>交易管理</a></li>
        <li class="layui-nav-item"><a href=""><i class="layui-icon layui-icon-read layui-icon-menu"></i>文章管理</a></li>
      </ul>
    </div>
  </div>
  
  <div class="layui-body">

 <div class="layui-tab" lay-allowClose="true" lay-filter="tabs">
  <ul class="layui-tab-title">
    <li lay-id="0" class="layui-this jsh-tab-none">网站首页</li> 
  </ul>
  <div class="layui-tab-content">
    <div class="layui-tab-item layui-show">
      <iframe scrolling="auto" frameborder="0" data-frameid='0' src="/manager/index/main" ></iframe>
    </div>
  </div>
</div>
      
</div>
          
    {{> footer}}
</div>
</div>



<script type="text/javascript">
window.onload = function(){

layui.use(['layer','form','element'], function(){
  var $ = layui.jquery;
    var layer = layui.layer,form = layui.form;
    var element = layui.element;

    var active = {
      tabAdd(url,id,title) {
            element.tabAdd('tabs', {
                title: title,
                content: '<iframe data-frameid="'+id+'" scrolling="auto" frameborder="0" src="'+url+'" style="width:100%;height:99%;"></iframe>',
                id: id //规定好的id
            })
        },
        tabChange(id){
          element.tabChange('tabs', id);
        }
    }

    //选项卡切换
    $('.site-demo-active').on('click', function() {
      var url = $(this).data('url');
      var id = $(this).data('id');
      var title = $(this).data('title');
      var label = true;

    $.each($('.layui-tab-content iframe'),function(){
        // console.log($(this).data("frameid"));
        if($(this).data("frameid") == id){
          label = false;
        }
      })
    if(label){
      active.tabAdd(url,id,title);
    }
    active.tabChange(id);
    })

    //顶部导航
    $('.jsh-nav-one').on('click', function() {
      active.tabChange(0);
    })
})

}

</script>
